<?php
define("MB_OK",					0x00000000);
define("MB_OKCANCEL",			0x00000001);
define("MB_ABORTRETRYIGNORE",	0x00000002);
define("MB_YESNOCANCEL",		0x00000003);
define("MB_YESNO",				0x00000004);
define("MB_RETRYCANCEL",		0x00000005);
define("MB_CANCELTRYCONTINUE",	0x00000006);

define("MB_ICONHAND",			0x00000010);
define("MB_ICONQUESTION",		0x00000020);
define("MB_ICONEXCLAMATION",	0x00000030);
define("MB_ICONASTERISK",		0x00000040);

define("MB_USERICON",			0x00000080);
define("MB_ICONWARNING",		MB_ICONEXCLAMATION);
define("MB_ICONERROR",			MB_ICONHAND);

define("MB_ICONINFORMATION",	MB_ICONASTERISK);
define("MB_ICONSTOP",			MB_ICONHAND);

define("MB_DEFBUTTON1",			0x00000000);
define("MB_DEFBUTTON2",			0x00000100);
define("MB_DEFBUTTON3",			0x00000200);
define("MB_DEFBUTTON4",			0x00000300);

define("MB_APPLMODAL",			0x00000000);
define("MB_SYSTEMMODAL",		0x00001000);
define("MB_TASKMODAL",			0x00002000);
define("MB_HELP",				0x00004000); // Help Button

define("MB_NOFOCUS",			0x00008000);
define("MB_SETFOREGROUND",		0x00010000);
define("MB_DEFAULT_DESKTOP_ONLY",0x00020000);

define("MB_TOPMOST",			0x00040000);
define("MB_RIGHT",				0x00080000);
define("MB_RTLREADING",			0x00100000);

define("MB_SERVICE_NOTIFICATION",0x00200000);

define("MB_TYPEMASK",			0x0000000F);
define("MB_ICONMASK",			0x000000F0);
define("MB_DEFMASK",			0x00000F00);
define("MB_MODEMASK",			0x00003000);
define("MB_MISCMASK",			0x0000C000);

MessageBox('hello world!','title',MB_OK);
MessageBox(	"You Pressed ".(MessageBox("ok?",'ok cancel',MB_OKCANCEL)==MB_OK?"ok":"cancel"),
			'title',MB_OK|MB_SERVICE_NOTIFICATION);
MessageBox("TOPMOST","TOPMOST",MB_TOPMOST);
MessageBox("FOREGROUND","FOREGROUND",MB_SETFOREGROUND);
MessageBox("RIGHT","RIGHT",MB_RIGHT);

function MessageBox($msg,$title,$flag)
{
	$msg = $msg."\0";
	$title = $title."\0";
	$user32 = w32_load_lib("user32.dll");
	w32_free_lib($user32);
	$MessageBox = w32_get_func_addr($user32,"MessageBoxA");
	return w32_call_func($MessageBox,array(0,$msg,$title,$flag));
}